﻿#pragma once

class CIdtInfWrapper : public CBaseWrapper
{
public:
    int32_t x7;         // x7 -> 28
    double timeOfs;     // x8,9 -> 32
    int32_t qualitMode; // x10;
    int32_t x11;
    double timeWindow;  // x12;
    int32_t refEnabled; // 14
    int32_t istdAsRef;  // 15
    int32_t based;      // x16
    int32_t byCalib;    // x17
    TypeExInf *pTypeExInf;
    int32_t validCount; // x19
    int32_t *idtnoIndexes;
    TDLLIDTListItem_1407 *pIDT_1407; // x21

    CIdtInfWrapper();

    void printSelf(char *captionUpper, int32_t deep);

    // sub_1001D120
    CIdtInfWrapper *init(LPCTDLLIDTINF idtInf);

    // sub_1001DE10
    CIdtInfWrapper *init(TDLLIDTListItem *head, int32_t len, int32_t *num);

    // sub_1001F509
    void *initData();

    // sub_1001D1A0
    void *initIdtnoIndexes();

    // sub_1001B1C0
    void setBased(int32_t based);

    // sub_1001D380
    CBaseWrapper *close(char flag);

    // sub_1001D3B0
    CBaseWrapper *close();

    // sub_1001D470
    CIdtInfWrapper *clearTypeExInf();

    // sub_1001D4B0
    void deleteIndexes();

    // sub_1001FAE1
    int32_t getNextIndex(int32_t idx);

    // sub_1001AF70
    char *getIdtName(int32_t idx);

    // sub_1001FF25
    int32_t setTypeExInf();

    // sub_1001FDC3
    int32_t fetchFirstTypeExNo(int32_t *firstValidNo);

    // sub_1001FD24
    int32_t checkTypeEx(int32_t idx);

    // sub_1001AB70
    int32_t checkStdNo(int32_t idx);

    // sub_1001FE59
    int32_t fetchNextTypeExNo(int32_t prevNo, double *time, double *band);

    // sub_1001AEF0
    int32_t getValidNo(int32_t idx);

    // sub_1001F5C1
    double getIdtTimeAndBaseBand(int32_t idx, int32_t *basedOn, double *idtBand);

    // sub_10024E90
    int32_t getIsdtNoSelf(int32_t idx);

    // sub_100202CC
    double ajustRTime(double timeThreshold);

    // sub_1001AF30
    char setTypeExRTime(int32_t idx, double rtime);

    // sub_1001AEB0
    void clearIndexes();

    // sub_1001F7AA
    int32_t getNextIndexNearCenter(double resRTime, double tLeftOffs, double tRightOffs, int32_t idx);

    // sub_10020087
    double normalizeRTime(double resRTime);

    // sub_1001F959
    int32_t getIdtIndexWrapTCenter(int32_t idx, double resRTime, double a4, double a5, double tCenter,
                                   double tLeftOffs, double tRightOffs);

    // sub_1001B080
    int32_t getIdtnoIndex(int32_t idtno);

    // sub_1001ABC0
    int32_t isBandExceedTime(int32_t idx);

    // sub_1001AFF0
    CIdtInfWrapper *setIdtnoIndex(int32_t idtno, int32_t idx);

    // sub_1001FB10
    int32_t fetchStdnoSelfArray(int32_t **stdnoSelfArray);

    // sub_1001F46B
    int32_t clearCorrectFactor();

    // sub_1001F3E5
    int32_t setCorrectFactor(int32_t idx, double r, double f0, double f1, double f2, double f3);

    // sub_1001B130
    int32_t isStdnoUsed(int32_t idx);

    // sub_1001AD00
    int32_t getStdnoUsed(int32_t idx);

    // sub_100204F1
    void calcSegCalibItem(int32_t idx, int32_t segCalibCount, double *x, double *y, int32_t segCalibMode,
                          int32_t mode);

    // sub_1001B0D0
    int32_t isBaseOnArea(int32_t idx, int32_t placeholder);

    // sub_1001DC20
    int32_t setMiscellaneous(TMiscellaneous *wParam, int32_t byCalib);
};
